﻿
function Nemo() {
    this.Initialized = false;
    this.Controllers = new Array();
};
Nemo.prototype.Init = function () {
    $.blockUI({
        theme: true,
        message: '<h1>Poczekaj jeszcze chwilkę ...</h1>'
    });
    for (var xc = 0; xc < this.Controllers.length; xc++) {
        if (this.Controllers[xc] && this.Controllers[xc].Init)
            this.Controllers[xc].Init();
    }
    this.Initialized = true;
};
Nemo.prototype.Load = function () {
    if (!this.Initialized) {
        window.setTimeout('window.Nemo.Load();', 50);
        return;
    }
    for (var xc = 0; xc < this.Controllers.length; xc++) {
        if (this.Controllers[xc] && this.Controllers[xc].Load)
            this.Controllers[xc].Load();
    }
    $.unblockUI();
};
Nemo.prototype.RegisterController = function (controller) {
    this.Controllers.push(controller);
};

window.Nemo = new Nemo();
$(window).load(function () {
    window.Nemo.Load();
});
$(function () {
    window.Nemo.Init();
});